@charset "UTF-8";
@import 'projects/components/src/style/index';

/*  ----------------------------------------------------------------------------------------------------- */
$max-width: 1920px; // TODO 暂未使用
$min-width: 1280px;

@keyframes headerIdentifier {
  0% {
    top: -48px;
  }

  100% {
    top: 0;
  }
}

body {
  height: 100%;
  margin: 0;
  color: $text-color;
  font-size: $font-size-base;
  font-family: $font-family;
  line-height: $line-height-base;
  background-color: $component-background; // TODO 主题切换
  -webkit-font-smoothing: antialiased;

  @include component-scroll;
}

a {
  color: $text-color-link;
  text-decoration: none;
  cursor: pointer;
}

.mt-64 {
  margin-top: -64px;
}

.icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  fill: #828282;
}

/* live design content container */
.live-design-content {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;

  lv-layout {
    background-color: $component-background; // TODO 主题切换
  }

  /* left menu container */
  .live-design-left-menu-container {
    height: 100vh;

    > div {
      padding-bottom: 24px;
      background: #1f2129;
    }

    /* 设置滚动条的样式 */
    ::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }

    /* 滚动槽 */
    ::-webkit-scrollbar-track {
      right: -4px;
      background-color: #1a1a1a;
      border-radius: 0;
    }

    /* 滚动条滑块 */
    ::-webkit-scrollbar-thumb {
      background-color: hsla(0deg, 0%, 100%, 0.3);
      border-radius: 8px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: hsla(0deg, 0%, 100%, 0.3);
    }

    ::-webkit-scrollbar-thumb:window-inactive {
      background-color: hsla(0deg, 0%, 100%, 0.3);
    }
  }

  .live-design-left-menu {
    width: 100%;
    height: auto;
    max-height: calc(100% - 134px);
    overflow-y: auto;

    // 左侧菜单使用深色滚动条，无法通用
    @include scroll-base;

    &::-webkit-scrollbar-thumb {
      border-color: #1a1a1a;
    }

    &::-webkit-scrollbar-thumb:hover {
      border-color: #1f2129;
    }

    &::-webkit-scrollbar-thumb:vertical {
      box-shadow: 4px 0 0 #4d4d4d inset;
    }

    &::-webkit-scrollbar-thumb:vertical:hover {
      box-shadow: 8px 0 0 #808080 inset;
    }

    &.lv-menu.lv-left-menu {
      padding-bottom: 0;

      &.lv-theme-dark {
        background: #1f2129;
      }

      ul.level0 {
        padding: 0;
      }

      &.lv-menu-icon {
        .level0 > li > .lv-menu-item {
          padding: 12px 16px;
        }

        .level1 > li > .lv-menu-item {
          padding: 8px 16px 8px 48px;
        }
      }

      ul > li > .lv-group-item-title {
        padding-top: 16px;
        margin-bottom: 8px;

        > span {
          padding-left: 24px;
        }
      }
    }

    &-label-container {
      display: flex;
      align-items: center;

      &.with-update-mark {
        justify-content: space-between;
      }

      .left-menu-icon {
        display: block;
        width: 24px;
        height: 24px;
        margin-right: 8px;
      }

      .live-design-update-mark {
        color: #ffffff;
        background-color: #2673e5;
      }

      lv-tag {
        margin-left: 24px;
      }
    }
  }

  &-wrapper {
    width: calc(100vw - 256px);
    height: 100vh;
    overflow-y: auto;
    background-color: transparent;

    @include component-scroll;

    &-dark {
      background-image: url('../images/site/background.png');
      background-size: 100% auto;
    }
  }

  &-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 64px;
    padding-right: 32px;
    white-space: nowrap;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 0.25s;
    transition-property: height;
    position: fixed;
    z-index: 1001;
    right: 0;
    animation: headerIdentifier 0.25s;

    &-hidden{
      display: none;
    }

    .live-design-search {
      width: 176px;

      &.search-dark {
        .lv-input-group {
          border-color: #333333;

          .lv-input {
            color: #e6e6e6;

            &::placeholder {
              color: #808080;
            }
          }
        }
      }
    }

    .live-design-frame {
      width: 120px;
      margin-left: 8px;

      &-trigger {
        display: flex;
        align-items: center;
      }
    }

    .live-design-version {
      width: 70px;
      margin-left: 8px;
    }

    .live-design-character {
      width: 100px;
      margin-left: 8px;
    }
  }
}

.live-design-logo-container {
  display: flex;
  align-items: center;
  height: 54px;
  margin: 32px 0 24px;
  padding: 0 32px;
  color: #ffffff;

  .live-design-logo {
    display: block;
    width: 48px;
    height: 48px;
    margin-right: 16px;
    background-size: 100%;

    &-text {
      font-weight: bold;
      font-size: 22px;
      line-height: 1.5;
    }
  }
}

.live-design-search-result {
  &-panel {
    .lv-popover-container .lv-popover-inner {
      width: 176px;
      max-height: 300px;
      padding: 0;
      overflow-y: auto;

      @include component-scroll;
    }

    &-dark .lv-popover-container .lv-popover-inner {
      background-color: #1f2129;
      box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.5);
    }
  }

  &-nodata {
    text-align: center;
  }

  &-content {
    ul {
      li {
        white-space: nowrap;

        &.live-design-search-result-component-item {
          a {
            display: block;
            box-sizing: border-box;
            width: 100%;
            height: 32px;
            padding: 0 8px;
            color: #1a1a1a;
            line-height: 32px;

            &:hover {
              color: #2673e5;
              background-color: #f9f9fa;
            }
          }
        }
      }
    }
  }
}

.live-design-search-result-dark {
  color: #e6e6e6;
  background-color: #1f2129;

  .live-design-search-result-content a {
    color: #e6e6e6 !important;

    &:hover {
      color: #2673e5 !important;
      background: rgba(61, 128, 225, 0.06) !important;
    }
  }
}

.live-design-frame-item-icon {
  display: inline-block;
  width: 16px;
  height: auto;
  margin-right: 4px;
  vertical-align: middle;
}

.frame-dark,
.version-dark,
.character-dark {
  .lv-select-wrapper {
    color: #e6e6e6;
    border-color: #333333;
  }
}

.frame-dark-panel,
.version-dark-panel,
.character-dark-panel {
  background-color: #1f2129;

  .lv-option {
    color: #e6e6e6;
    background: transparent;

    &:hover {
      background: rgba(255, 255, 255, 0.05);
    }

    &:not(.lv-option-multiple).selected {
      color: #2673e5;
      background: rgba(38, 115, 229, 0.06);
    }
  }
}

/* markdown container */
.design-markdown-container,
.markdown {
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-top: 8px;
    color: $text-color;
    font-weight: 400;
  }

  code {
    margin: 0 1px;
    padding: 0.2em 0.4em;
    background: rgba(0, 0, 0, 0.04);
    font-family: $font-family;
  }
}

.design-markdown-container {
  h2 {
    margin-top: 64px;
    font-size: 24px;
    line-height: 30px;
  }

  h3 {
    margin-top: 48px;
  }

  h4 {
    margin-top: 32px;
    font-size: 18px;
  }

  h5 {
    margin-top: 24px;
    font-size: 16px;
  }

  h6 {
    margin-top: 16px;
  }

  p {
    margin-top: 8px;
    color: $text-color-secondary;
    font-size: 14px;
    line-height: 22px;

    img,
    video {
      max-width: 100%;
      margin-top: 12px;
    }

    img.icon {
      width: 16px;
      height: 16px;
      margin: 0;
    }
  }

  blockquote {
    margin: 8px 0;
    padding: 0 24px;
    overflow: hidden;
    color: grey;
    border-left: 4px solid $border-color-base;

    p {
      margin: 8px 0;
    }
  }

  pre[class*='language-'] {
    padding: 24px 40px;
    background-color: #f9f9fa;
    background-image: none;
  }

  pre[class*='language-']::before,
  pre[class*='language-']::after {
    display: none;
  }

  > ol,
  > ul {
    padding: 8px 0 8px 18px;

    li {
      margin-bottom: 0;
      padding: 4px 0;
    }
  }

  > ol {
    li {
      list-style: decimal;
    }
  }

  > ul {
    li {
      list-style: disc;
    }
  }

  li {
    ul {
      margin-left: 18px;

      li {
        list-style: circle;
      }
    }
  }

  .flex-start {
    display: flex;
    align-items: flex-start;

    .flex-item:first-child {
      margin-right: 8px;
    }
  }

  .inline-img {
    width: auto;
    height: 24px;
    margin-top: 8px;
  }

  table {
    width: 100%;
    margin-top: 16px;
    text-align: left;
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
  }

  thead {
    color: $text-color-secondary;
    font-size: 14px;
    line-height: 1.5;

    > tr > th {
      padding: 8px;
      font-weight: 700;
      text-align: center;
      background-color: #f7f7f7;
      border: 1px solid $border-color-base;

      &:first-child {
        padding-left: 16px;
      }

      &:last-child {
        border-right: none;
      }
    }
  }

  tbody {
    > tr > td {
      height: 40px;
      padding: 0 8px;
      color: $text-color;
      vertical-align: middle;
      border: 1px solid $border-color-base;

      &:first-child {
        padding-left: 16px;
      }
    }
  }
}

.design-markdown-footer {
  margin-top: 46px;
  padding-top: 10px;
  border-top: 1px solid $border-color-split;

  > img {
    width: 100%;
    max-width: 1200px;
  }
}

.component-markdown {
  h2 {
    margin-top: 64px;
  }

  h4 {
    font-size: 20px;
  }
}

/* Code Styles */
pre {
  margin: 10px 0;
  padding: 1em;
  color: #333333;
  font-size: 14px;
  white-space: pre-wrap;
  white-space: -moz-pre-wrap;
  white-space: -o-pre-wrap;
  word-wrap: break-word;
  background-color: #f3f4f5;
  border-radius: 2px;
}

.content-section {
  display: block;
  overflow: hidden;
}

.content-section-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: -24px;

  > * {
    margin-top: 24px;
    margin-right: 48px;

    &:last-child {
      margin-right: 0;
    }
  }
}

.content-section-column {
  display: flex;
  flex-direction: column;
  margin-top: -24px;

  > * {
    margin-top: 24px;
  }
}

.flex-nowrap {
  flex-wrap: nowrap;
}

.content-section-list {
  h3 {
    margin-bottom: 8px;
  }
}

.live-design-character-box {
  padding-top: 8px;
}

.live-design-character-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 208px;

  img {
    width: 80px;
    height: 80px;
    margin-top: 24px;
  }

  div {
    font-weight: bold;
    text-align: center;
  }

  &.lv-card-checked {
    color: #2673e5;
  }
}

.ui-anchor-wrapper {
  @include component-scroll;
}
